﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Contract.Paging
{
    public class PageRecord
    {
        public Nullable<int> PageIndex { get; set; }
        public Nullable<int> PageSize { get; set; }
        public Nullable<int> TotalPages
        {
            get
            {
                if (!PageSize.HasValue || PageSize <= 0) return null;
                if (TotalRecords <= 0) return null;
                return TotalRecords % PageSize == 0 ? TotalRecords / PageSize : TotalRecords / PageSize + 1;
            }
        }
        public int TotalRecords { get; set; }
    }
}
